<script type="text/javascript">
	function onlyNumbers(evt) 
	{
		evt = (evt) ? evt : window.event
		var charCode = (evt.which) ? evt.which : evt.keyCode
		if (charCode > 31 && (charCode < 48 || charCode > 57)) {
			//status = "This field accepts numbers only."
			alert("Harus di Isi Angka");
			return false
		}
		//status = ""
		return true 	
	}
</script>
<form method="post" name="frmSearch" action="<?php echo site_url('mstraccountcontroller');?>">
	<table width="100%" cellpadding="3" cellspacing="0" border="1">
        <tr>
            <td width="109"><strong>Pilih Search</strong></td>
            <td width="22" align="center">:</td>
            <td width="840" colspan="3">
                <select name="kdbankview">
                    <option value="0">Pilih</option>
                    <option value="1">Kode Bank</option>
                    <option value="2">Nama Bank</option>
                    <option value="3">NO Rekening</option>
                </select> &nbsp;|&nbsp;<input type="text"  name="bankview" id="bankview" size="50" />&nbsp;|&nbsp;<input type="submit" name="btnview" value="Search">
            </td>
		</tr>
    </table>
</form>
<br />
<form method="post" name="frminput" action="<?php echo site_url('mstraccountcontroller/tambahmstraccount');?>">
    <table width="100%" cellpadding="3" cellspacing="0" border="1">
    	<tr style="background-color:#FFF; color:#000000;" align="center">
        	<td colspan="3" height="25"><strong>INFORMASI REKENING</strong></td>
    	</tr>
        <tr>
            <td width="105"><strong>Nama Bank</strong></td>
            <td width="18" align="center">:</td>
            <td width="848">
                <select name="kdbank">
                    <?php 
						$count = count($masterbank);
                    	foreach($masterbank as $comboInd)
						{
                    ?>
                    	<option value="<?php echo $comboInd->KodeBank?>"><?php echo $comboInd->Bankname;?></option>
                    <?php }?>
                </select></td>
        </tr>
        <tr>
            <td width="105"><strong>Saldo Awal</strong></td>
            <td width="18" align="center">:</td>
            <td ><input type="text"  name="sldawal" id="sldawal" size="25" maxlength="20" onkeypress="return onlyNumbers(event);"/></td>
        </tr>
        <tr>
            <td width="105"><strong>Saldo Akhir</strong></td>
            <td width="18" align="center">:</td>
            <td ><input type="text"  name="sldakhir" id="sldakhir" size="25" onkeypress="return onlyNumbers(event);"/></td>
        </tr>
        <tr>
            <td colspan="3" align="center"><input type="submit" value="Save" name="btnSave" >&nbsp;<input type="button" name="btnClose" value="Back" class="btn" onclick="javascript:window.location='<?php echo site_url('menuhomecontroller'); ?>';" /></td>
        </tr>
    </table>
</form>
<div class="cleaner_h10"></div>
<br />
<table border="1" cellpadding="3" cellspacing="0" width="100%" style=" border-collapse: collapse;" class="record" bordercolor="#CCCCCC">
    <tr style="background-color:#FFF; color:#000000;" align="center">
        <td colspan="8" height="25">LIST INFORMASI REKENING</td>
    </tr>
    <tr style="background-color:#333; color:#FFF;" align="center">
        <td>Kode Bank</td>
        <td>Nama Bank</td>
        <td>No Rekening</td>
        <td>Saldo Awal</td>
        <td>Uang Masuk</td>
        <td>Uang Keluar</td>
        <td>Saldo Akhir</td>
        <?php
		if($this->session->userdata('grade') == 0)
		{
		?>
        <td>&nbsp;</td>
        <?php } ?>
    </tr>
	<?php if(count($masteraccount)>0){ ?>
        {masteraccount}
            <tr class="cellDefault">
                <td align="center">{KodeBank}</td>
                <td align="center">{Bankname}</td>
                <td align="center">{NoRekening}</td>
                <td align="center">{SaldoAwal}</td>
                <td align="center">{Uangmasuk}</td>
                <td align="center">{Uangkeluar}</td>
                <td align="center">{SaldoAkhir}</td>
                <td align="center">
                <?php
                if($this->session->userdata('grade') == 0)
				{
				?>
                    <a href="<?php echo site_url('mstraccountcontroller/ubahmstraccount');?>/{KodeBank}">Edit</a>
                <?php } ?>
                   <!-- &nbsp;|&nbsp;
                    <a href="<?php echo site_url('mstraccountcontroller/deletemstraccount');?>/{KodeBank}">Hapus</a>-->
				</td>
            </tr>
        {/masteraccount}
    <?php } else{
            echo "<tr>";
            echo "<td colspan='9' style='text-align:center;color:red;'>No Data To Display</td>";
            echo "</tr>";
    } ?>
    <?php if(!empty($message))?>{message}
</table>
<?php echo $links; ?>